/*
 * @lc app=leetcode.cn id=168 lang=csharp
 *
 * [168] Excel表列名称
 */

// @lc code=start
public class Solution {
    public string ConvertToTitle(int columnNumber) {
        StringBuilder sb = new StringBuilder();
        while (columnNumber > 0)
        {
            sb.Append( (char)('A' + --columnNumber % 26));
            columnNumber /= 26;
        }
        var sb2 = new StringBuilder();
        for (int i = sb.Length - 1; i >= 0; i--)
        {
            sb2.Append(sb[i]);
        }
        return sb2.ToString();
    }
}
// @lc code=end

